package com.zhao.teminalExpression;

import com.zhao.abstractExpression.AbstractExpression;
import com.zhao.context.Context;

public class Variable implements AbstractExpression {

    private String name;

    public Variable(String name) {
        this.name = name;
    }

    @Override
    public int interpret(Context context) {
        return context.getValue(this);
    }

    @Override
    public String toString() {
        return name;
    }
}
